#include <iostream>
using std::cout;
using std::endl;

class Point{
public:
    //explicit放在构造函数前，禁止隐式转换
    explicit
    Point(int ix,int iy = 0)
    : _ix(ix)
    , _iy(iy)
    {cout << "Point(int = 0,int = 0)" << endl;}

    void print() const{
        cout << "(" << _ix << ","
            << _iy << ")" << endl;
    }
private:
    int _ix;
    int _iy;
};

void test0(){
    Point pt(1);
    pt.print();
    //编译器在进行编译时，左边是一个Point类型，右边是一个int类型
    //编译器会找到Point类中，尝试用这个int型数据区创建一个
    //Point类型的对象
    //Point pt2 = Point(2);
    //隐式转换
    /* Point pt2 = 2; */
    /* pt2.print(); */
}

int main(void){
    test0();
    return 0;
}
